from django.db import models

# Create your models here.
class Yonghu(models.Model):
    ROLE=[
        ('1','学生'),
        ('2','老师')
    ]
    ID=models.AutoField(primary_key=True)
    uname=models.CharField(max_length=20,null=False,blank=False)
    upwd=models.CharField(max_length=20,null=False)
    role=models.CharField(max_length=1,choices=ROLE)

    class Meta:
        db_table='Yonghu'

class Leave_type(models.Model):
    ID=models.AutoField(primary_key=True)
    tname=models.CharField(max_length=20,null=False)

    class Meta:
        db_table='Leave_type'


class Qingjiashenpi(models.Model):
    STATUS=[
        ('0','待审核'),
        ('1','通过'),
        ('2','未通过')
    ]
    ID=models.AutoField(primary_key=True)
    stu_name=models.CharField(max_length=20,null=False)
    status=models.CharField(max_length=1,choices=STATUS,default='0')
    createtime=models.DateField(auto_now_add=True,null=False)
    context=models.CharField(max_length=200,null=False)
    tname=models.CharField(max_length=200)
    leixing=models.CharField(max_length=200,null=False,blank=False)
    tid=models.ForeignKey(Leave_type,on_delete=models.CASCADE)